﻿/*---------WebSocket 测试---------*/
var displayPanel = $("#GetTest");
var wsImpl = window.WebSocket || window.MozWebSocket;
window.ws = new wsImpl(url, 'my-protocol');

ws.onmessage = function (evt) {
    displayPanel.html(evt.data);
};

// 连接被打开
ws.onopen = function () {
    displayPanel.html('websocket打开，你还在浪费时间吗？');
};

// 连接被关闭
ws.onclose = function () {
    displayPanel.html('.. connection closed');
}

//发送信息
//ws.send(123);